<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{d5_sta:d5_siteName}</title>
<base href='{d5_sta:d5_siteDomain}' />
<link rel="stylesheet" type="text/css" href="{d5_sta:d5_skin_type}/base/css/layout.css">
<script type="text/javascript" language="javascript" src="{d5_sta:d5_skin_type}/js/jooyea.js"></script>
<script type="text/javascript" language="javascript" src="{d5_sta:d5_skin_type}/js/login.js"></script>
<script type="text/javascript" language="javascript" src="{d5_sta:d5_siteurl}/servtools/ajax_client/ajax.js"></script>
<script type="text/javascript" language="javascript" src="{d5_sta:d5_siteurl}/servtools/dialog/zDialog.js"></script>
<script type="text/javascript" language="javascript" src="{d5_sta:d5_siteurl}/servtools/dialog/zDrag.js"></script>
</head>

<script language="javascript">
function goLogin(){
	Dialog.confirm("登录后才能执行操作,现在登录？",function(){top.location="index.php";});
}
function getEnt(){
	document.onkeydown = function (e){
		var theEvent = window.event || e;
		var code = theEvent.keyCode || theEvent.which;
		if(code == 13){
			  login();
		}
	}
}
function inputTxt(obj,act)
{
  var str="{echo:lp{ah_enter_name};/}";
  if(obj.value==''&&act=='set')
  {
     obj.value=str;
     obj.style.color='#cccccc';
  }
  if(obj.value==str&&act=='clean')
  {
     obj.value='';
     obj.style.color='gray';
  }
}
//ajax
function login_callback(content)
{
	var check=/\.php/;
	if(check.test(content)){
		 if($("tmpiId").checked){
			saveTmpEmail(1);
		 }else{
			  saveTmpEmail(0);
		 }
		 window.location.href=content;
	}else{
		$("emailmsg").innerHTML = '';
		$("pwdmsg").innerHTML = '';
		$("loadingmsg").innerHTML = '';
		var return_array=content.split("|");
		if($(return_array[0])){
			$(return_array[0]).innerHTML = return_array[1];
		}else if(return_array[0]=='active'){
			window.location.href="modules.php?app=user_activation";
		}
	}
}
function login_unready_callback(){
	var argb_div = $("loadingmsg");
	if($("emailmsg").innerHTML == '' || $("pwdmsg").innerHTML == ''){
		argb_div.innerHTML='';
	}else{
		argb_div.innerHTML="<img src='{d5_sta:d5_skin_image}/base/images/login_loading.gif' align='top' >登录连接中...";
	}
}
function saveTmpEmail(para){
	var email_time=new Date();
	var login_time=new Date();
	email_time.setTime(email_time.getTime() +3600*1000*24*300 );
	login_time.setTime(login_time.getTime() +3600*250 );
	if(para==1){
		var uemailStr=$("login_email").value;
		document.cookie='iweb_email='+uemailStr+';expires='+ email_time.toGMTString();
	}
	document.cookie="IsReged=Y;expires="+ login_time.toGMTString();
}
function login(){
	u_email=$('login_email').value;
	u_pws=$('login_pws').value;
	u_hidden=0;
	if($('hidden').checked){
		u_hidden=1;
	}
	var ajax_login=new Ajax();
	ajax_login.getInfo("do.php?act=login","post","app","u_email="+u_email+"&u_pws="+u_pws+"&hidden="+u_hidden,function(c){login_callback(c);},function(){login_unready_callback();});
}
//取得cookie值
$('login_email').value=get_cookie('iweb_email');
</script>

<body id="index">
<div class="container">
{inc:require('uiparts/guestheader.php');/}
	<div class="wrapper">
        <div class="main"> 
<div class="login">
    <h2>用户登录 <span id="loadingmsg"></span></h2>
    <form name="login_form" method="post" onsubmit="return false;">
        <p><label>登录邮箱： <span id="emailmsg" class="red"></span></label><input class="input" name="login_email" id="login_email" type="text" /></p>
        <p><label>密码： <span id="pwdmsg" class="red"></span></label><input class="pwd" name="login_pws" id="login_pws" type="password" /></p>
        <p class="chk">
            <label for="tmpiId"><input name="tmpiId" class="chk" id="tmpiId" type="checkbox" value="save" checked="checked" onKeyDown="getEnt();">记住我</label>
            <label for="hidden"><input name="hidden" class="chk" id="hidden" type="checkbox" value="1" onKeyDown="getEnt();">隐身登录 </label>
        </p>
        <p><span><a href="modules.php?app=user_forget" class="forget">忘记密码？</a></span>
        <input type="submit" onclick="login();" class="button"  name="loginsubm" id="loginsubm" hidefocus="true" value="登录"></p>
    </form>
</div>
  	 </div>  
   </div>  
{inc:require('uiparts/footor.php');/}
</div>  
</body>
</html>